﻿#ifndef __SCHEDULE_H__
#define __SCHEDULE_H__
#include "rec_info.h"

class CSchedule
{
public:
    //interface
    CSchedule();
    CSchedule(const SCHDULE_REC & schedule);
    ~CSchedule();

    void SetFSAPISchedule(const SCHDULE_REC & schedule)
    {
        memcpy(&m_schedule,&schedule,sizeof(SCHDULE_REC));
    }

    void GetFSAPIScheduleTime(SCHDULE_REC * schedule)
    {
        memcpy(schedule,&m_schedule,sizeof(SCHDULE_REC));
    }

    void SetEnable(bool bEnable)
    {
        m_schedule.is_Enable = bEnable;
    }

    bool IsEnable()
    {
        return (bool)m_schedule.is_Enable;
    }

    bool IsEffectTime(const time_t timeSecs);

protected:

    //methods
    bool GetWeekdaySchedule(uint16_t wDay, uint16_t hour, uint16_t min);
    bool GetDefaultSchedule(const int64_t & time);
    //variable
    //SCHEDULE_REC_TIME		m_schedule;

    SCHDULE_REC	    m_schedule;
    //CCalendar				m_calendar;
};
#endif //__SCHEDULE_H__
